3.5.59 \(\int \frac {\tan ^3(c+d x)}{a+b \tan (c+d x)} \, dx\) [459]

Optimal. Leaf size=79 \[ -\frac {b x}{a^2+b^2}+\frac {a \log (\cos (c+d x))}{\left (a^2+b^2\right ) d}-\frac {a^3 \log (a+b \tan (c+d x))}{b^2 \left (a^2+b^2\right ) d}+\frac {\tan (c+d x)}{b d} \]

[Out]

-b*x/(a^2+b^2)+a*ln(cos(d*x+c))/(a^2+b^2)/d-a^3*ln(a+b*tan(d*x+c))/b^2/(a^2+b^2)/d+tan(d*x+c)/b/d

________________________________________________________________________________________

Rubi [A]
time = 0.09, antiderivative size = 79, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3647, 3707, 3698, 31, 3556} \begin {gather*} \frac {a \log (\cos (c+d x))}{d \left (a^2+b^2\right )}-\frac {b x}{a^2+b^2}-\frac {a^3 \log (a+b \tan (c+d x))}{b^2 d \left (a^2+b^2\right )}+\frac {\tan (c+d x)}{b d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]^3/(a + b*Tan[c + d*x]),x]

[Out]

-((b*x)/(a^2 + b^2)) + (a*Log[Cos[c + d*x]])/((a^2 + b^2)*d) - (a^3*Log[a + b*Tan[c + d*x]])/(b^2*(a^2 + b^2)*
d) + Tan[c + d*x]/(b*d)

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3647

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Si
mp[b^2*(a + b*Tan[e + f*x])^(m - 2)*((c + d*Tan[e + f*x])^(n + 1)/(d*f*(m + n - 1))), x] + Dist[1/(d*(m + n -
1)), Int[(a + b*Tan[e + f*x])^(m - 3)*(c + d*Tan[e + f*x])^n*Simp[a^3*d*(m + n - 1) - b^2*(b*c*(m - 2) + a*d*(
1 + n)) + b*d*(m + n - 1)*(3*a^2 - b^2)*Tan[e + f*x] - b^2*(b*c*(m - 2) - a*d*(3*m + 2*n - 4))*Tan[e + f*x]^2,
 x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0]
&& IntegerQ[2*m] && GtQ[m, 2] && (GeQ[n, -1] || IntegerQ[m]) &&  !(IGtQ[n, 2] && ( !IntegerQ[m] || (EqQ[c, 0]
&& NeQ[a, 0])))

Rule 3698

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Dist[
A/(b*f), Subst[Int[(a + x)^m, x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, A, C, m}, x] && EqQ[A, C]

Rule 3707

Int[((A_) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2)/((a_.) + (b_.)*tan[(e_.) + (f_.)*
(x_)]), x_Symbol] :> Simp[(a*A + b*B - a*C)*(x/(a^2 + b^2)), x] + (Dist[(A*b^2 - a*b*B + a^2*C)/(a^2 + b^2), I
nt[(1 + Tan[e + f*x]^2)/(a + b*Tan[e + f*x]), x], x] - Dist[(A*b - a*B - b*C)/(a^2 + b^2), Int[Tan[e + f*x], x
], x]) /; FreeQ[{a, b, e, f, A, B, C}, x] && NeQ[A*b^2 - a*b*B + a^2*C, 0] && NeQ[a^2 + b^2, 0] && NeQ[A*b - a
*B - b*C, 0]

Rubi steps

\begin {align*} \int \frac {\tan ^3(c+d x)}{a+b \tan (c+d x)} \, dx &=\frac {\tan (c+d x)}{b d}+\frac {\int \frac {-a-b \tan (c+d x)-a \tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx}{b}\\ &=-\frac {b x}{a^2+b^2}+\frac {\tan (c+d x)}{b d}-\frac {a \int \tan (c+d x) \, dx}{a^2+b^2}-\frac {a^3 \int \frac {1+\tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx}{b \left (a^2+b^2\right )}\\ &=-\frac {b x}{a^2+b^2}+\frac {a \log (\cos (c+d x))}{\left (a^2+b^2\right ) d}+\frac {\tan (c+d x)}{b d}-\frac {a^3 \text {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \tan (c+d x)\right )}{b^2 \left (a^2+b^2\right ) d}\\ &=-\frac {b x}{a^2+b^2}+\frac {a \log (\cos (c+d x))}{\left (a^2+b^2\right ) d}-\frac {a^3 \log (a+b \tan (c+d x))}{b^2 \left (a^2+b^2\right ) d}+\frac {\tan (c+d x)}{b d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 0.42, size = 91, normalized size = 1.15 \begin {gather*} -\frac {\frac {\log (i-\tan (c+d x))}{a+i b}+\frac {\log (i+\tan (c+d x))}{a-i b}+\frac {2 a^3 \log (a+b \tan (c+d x))}{b^2 \left (a^2+b^2\right )}-\frac {2 \tan (c+d x)}{b}}{2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]^3/(a + b*Tan[c + d*x]),x]

[Out]

-1/2*(Log[I - Tan[c + d*x]]/(a + I*b) + Log[I + Tan[c + d*x]]/(a - I*b) + (2*a^3*Log[a + b*Tan[c + d*x]])/(b^2
*(a^2 + b^2)) - (2*Tan[c + d*x])/b)/d

________________________________________________________________________________________

Maple [A]
time = 0.14, size = 79, normalized size = 1.00

method result size
derivativedivides \(\frac {\frac {\tan \left (d x +c \right )}{b}+\frac {-\frac {a \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}-b \arctan \left (\tan \left (d x +c \right )\right )}{a^{2}+b^{2}}-\frac {a^{3} \ln \left (a +b \tan \left (d x +c \right )\right )}{b^{2} \left (a^{2}+b^{2}\right )}}{d}\) \(79\)
default \(\frac {\frac {\tan \left (d x +c \right )}{b}+\frac {-\frac {a \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}-b \arctan \left (\tan \left (d x +c \right )\right )}{a^{2}+b^{2}}-\frac {a^{3} \ln \left (a +b \tan \left (d x +c \right )\right )}{b^{2} \left (a^{2}+b^{2}\right )}}{d}\) \(79\)
norman \(\frac {\tan \left (d x +c \right )}{b d}-\frac {b x}{a^{2}+b^{2}}-\frac {a \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d \left (a^{2}+b^{2}\right )}-\frac {a^{3} \ln \left (a +b \tan \left (d x +c \right )\right )}{b^{2} \left (a^{2}+b^{2}\right ) d}\) \(85\)
risch \(-\frac {i x}{i b -a}+\frac {2 i a^{3} x}{b^{2} \left (a^{2}+b^{2}\right )}+\frac {2 i a^{3} c}{b^{2} d \left (a^{2}+b^{2}\right )}-\frac {2 i a x}{b^{2}}-\frac {2 i a c}{b^{2} d}+\frac {2 i}{b d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {a^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right )}{b^{2} d \left (a^{2}+b^{2}\right )}+\frac {a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{b^{2} d}\) \(167\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)^3/(a+b*tan(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(1/b*tan(d*x+c)+1/(a^2+b^2)*(-1/2*a*ln(1+tan(d*x+c)^2)-b*arctan(tan(d*x+c)))-1/b^2*a^3/(a^2+b^2)*ln(a+b*ta
n(d*x+c)))

________________________________________________________________________________________

Maxima [A]
time = 0.52, size = 85, normalized size = 1.08 \begin {gather*} -\frac {\frac {2 \, a^{3} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{2} b^{2} + b^{4}} + \frac {2 \, {\left (d x + c\right )} b}{a^{2} + b^{2}} + \frac {a \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} - \frac {2 \, \tan \left (d x + c\right )}{b}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+b*tan(d*x+c)),x, algorithm="maxima")

[Out]

-1/2*(2*a^3*log(b*tan(d*x + c) + a)/(a^2*b^2 + b^4) + 2*(d*x + c)*b/(a^2 + b^2) + a*log(tan(d*x + c)^2 + 1)/(a
^2 + b^2) - 2*tan(d*x + c)/b)/d

________________________________________________________________________________________

Fricas [A]
time = 1.30, size = 111, normalized size = 1.41 \begin {gather*} -\frac {2 \, b^{3} d x + a^{3} \log \left (\frac {b^{2} \tan \left (d x + c\right )^{2} + 2 \, a b \tan \left (d x + c\right ) + a^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) - {\left (a^{3} + a b^{2}\right )} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right ) - 2 \, {\left (a^{2} b + b^{3}\right )} \tan \left (d x + c\right )}{2 \, {\left (a^{2} b^{2} + b^{4}\right )} d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+b*tan(d*x+c)),x, algorithm="fricas")

[Out]

-1/2*(2*b^3*d*x + a^3*log((b^2*tan(d*x + c)^2 + 2*a*b*tan(d*x + c) + a^2)/(tan(d*x + c)^2 + 1)) - (a^3 + a*b^2
)*log(1/(tan(d*x + c)^2 + 1)) - 2*(a^2*b + b^3)*tan(d*x + c))/((a^2*b^2 + b^4)*d)

________________________________________________________________________________________

Sympy [C] Result contains complex when optimal does not.
time = 0.57, size = 554, normalized size = 7.01 \begin {gather*} \begin {cases} \tilde {\infty } x \tan ^{2}{\left (c \right )} & \text {for}\: a = 0 \wedge b = 0 \wedge d = 0 \\- \frac {3 d x \tan {\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} - 2 i b d} + \frac {3 i d x}{2 b d \tan {\left (c + d x \right )} - 2 i b d} + \frac {i \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )} \tan {\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} - 2 i b d} + \frac {\log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 b d \tan {\left (c + d x \right )} - 2 i b d} + \frac {2 \tan ^{2}{\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} - 2 i b d} + \frac {3}{2 b d \tan {\left (c + d x \right )} - 2 i b d} & \text {for}\: a = - i b \\- \frac {3 d x \tan {\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} + 2 i b d} - \frac {3 i d x}{2 b d \tan {\left (c + d x \right )} + 2 i b d} - \frac {i \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )} \tan {\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} + 2 i b d} + \frac {\log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 b d \tan {\left (c + d x \right )} + 2 i b d} + \frac {2 \tan ^{2}{\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} + 2 i b d} + \frac {3}{2 b d \tan {\left (c + d x \right )} + 2 i b d} & \text {for}\: a = i b \\\frac {- \frac {\log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {\tan ^{2}{\left (c + d x \right )}}{2 d}}{a} & \text {for}\: b = 0 \\\frac {x \tan ^{3}{\left (c \right )}}{a + b \tan {\left (c \right )}} & \text {for}\: d = 0 \\- \frac {2 a^{3} \log {\left (\frac {a}{b} + \tan {\left (c + d x \right )} \right )}}{2 a^{2} b^{2} d + 2 b^{4} d} + \frac {2 a^{2} b \tan {\left (c + d x \right )}}{2 a^{2} b^{2} d + 2 b^{4} d} - \frac {a b^{2} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 a^{2} b^{2} d + 2 b^{4} d} - \frac {2 b^{3} d x}{2 a^{2} b^{2} d + 2 b^{4} d} + \frac {2 b^{3} \tan {\left (c + d x \right )}}{2 a^{2} b^{2} d + 2 b^{4} d} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)**3/(a+b*tan(d*x+c)),x)

[Out]

Piecewise((zoo*x*tan(c)**2, Eq(a, 0) & Eq(b, 0) & Eq(d, 0)), (-3*d*x*tan(c + d*x)/(2*b*d*tan(c + d*x) - 2*I*b*
d) + 3*I*d*x/(2*b*d*tan(c + d*x) - 2*I*b*d) + I*log(tan(c + d*x)**2 + 1)*tan(c + d*x)/(2*b*d*tan(c + d*x) - 2*
I*b*d) + log(tan(c + d*x)**2 + 1)/(2*b*d*tan(c + d*x) - 2*I*b*d) + 2*tan(c + d*x)**2/(2*b*d*tan(c + d*x) - 2*I
*b*d) + 3/(2*b*d*tan(c + d*x) - 2*I*b*d), Eq(a, -I*b)), (-3*d*x*tan(c + d*x)/(2*b*d*tan(c + d*x) + 2*I*b*d) -
3*I*d*x/(2*b*d*tan(c + d*x) + 2*I*b*d) - I*log(tan(c + d*x)**2 + 1)*tan(c + d*x)/(2*b*d*tan(c + d*x) + 2*I*b*d
) + log(tan(c + d*x)**2 + 1)/(2*b*d*tan(c + d*x) + 2*I*b*d) + 2*tan(c + d*x)**2/(2*b*d*tan(c + d*x) + 2*I*b*d)
 + 3/(2*b*d*tan(c + d*x) + 2*I*b*d), Eq(a, I*b)), ((-log(tan(c + d*x)**2 + 1)/(2*d) + tan(c + d*x)**2/(2*d))/a
, Eq(b, 0)), (x*tan(c)**3/(a + b*tan(c)), Eq(d, 0)), (-2*a**3*log(a/b + tan(c + d*x))/(2*a**2*b**2*d + 2*b**4*
d) + 2*a**2*b*tan(c + d*x)/(2*a**2*b**2*d + 2*b**4*d) - a*b**2*log(tan(c + d*x)**2 + 1)/(2*a**2*b**2*d + 2*b**
4*d) - 2*b**3*d*x/(2*a**2*b**2*d + 2*b**4*d) + 2*b**3*tan(c + d*x)/(2*a**2*b**2*d + 2*b**4*d), True))

________________________________________________________________________________________

Giac [A]
time = 0.90, size = 86, normalized size = 1.09 \begin {gather*} -\frac {\frac {2 \, a^{3} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{2} b^{2} + b^{4}} + \frac {2 \, {\left (d x + c\right )} b}{a^{2} + b^{2}} + \frac {a \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} - \frac {2 \, \tan \left (d x + c\right )}{b}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+b*tan(d*x+c)),x, algorithm="giac")

[Out]

-1/2*(2*a^3*log(abs(b*tan(d*x + c) + a))/(a^2*b^2 + b^4) + 2*(d*x + c)*b/(a^2 + b^2) + a*log(tan(d*x + c)^2 +
1)/(a^2 + b^2) - 2*tan(d*x + c)/b)/d

________________________________________________________________________________________

Mupad [B]
time = 4.11, size = 94, normalized size = 1.19 \begin {gather*} \frac {\mathrm {tan}\left (c+d\,x\right )}{b\,d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )}{2\,d\,\left (a-b\,1{}\mathrm {i}\right )}-\frac {a^3\,\ln \left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )}{b^2\,d\,\left (a^2+b^2\right )}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,1{}\mathrm {i}}{2\,d\,\left (-b+a\,1{}\mathrm {i}\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)^3/(a + b*tan(c + d*x)),x)

[Out]

tan(c + d*x)/(b*d) - log(tan(c + d*x) + 1i)/(2*d*(a - b*1i)) - (log(tan(c + d*x) - 1i)*1i)/(2*d*(a*1i - b)) -
(a^3*log(a + b*tan(c + d*x)))/(b^2*d*(a^2 + b^2))

________________________________________________________________________________________